import React from 'react'
import ReactDOM from 'react-dom'
import * as serviceWorker from './serviceWorker'
import 'antd-mobile/dist/antd-mobile.css'
import { HashRouter, Switch, Route } from 'react-router-dom'

import { Provider } from 'react-redux'
import store from './redux/store'

import Login from './continers/login/login'
import Main from './continers/main/main'
import register from './continers/register/register'
import LaobanInfo from './continers/laoban-info/laoban-info'
import DashenInfo from './continers/dashen-info/dashen-info'
import './assets/css/index.sass'
require('./mock/user')

ReactDOM.render(
  <Provider store={store}>
    <HashRouter>
      <Switch>
        <Route path="/login" component={Login} />
        <Route path="/register" component={register} />
        <Route path="/laobaninfo" component={LaobanInfo} />
        <Route path="/dasheninfo" component={DashenInfo} />
        <Route component={Main} />
      </Switch>
    </HashRouter>
  </Provider>,
  document.getElementById('root')
)

// If you want your app to work offline and load faster, you can change
// unregister() to register() below. Note this comes with some pitfalls.
// Learn more about service workers: https://bit.ly/CRA-PWA
serviceWorker.unregister()
